		<div class="clearfix form-actions center" style="margin-top:15px;margin-bottom:5px;">
			<div class="col-md-offset-1 col-md-10">
			@if(!isEmpty(btn_save)){
			  	<button class="btn btn-info" type="submit" id="btn_save">
					<i class="ace-icon fa fa-check bigger-110"></i>
					${btn_save!}
				</button>
			@}

			@if(!isEmpty(btn_close)){
				&nbsp; &nbsp; &nbsp;
				<button class="btn" type="button" id="btn_close">
					<i class="ace-icon fa fa-close bigger-110"></i>
					${btn_close!}
				</button>
			@}
			</div>
		</div>
		<script src="${ctxPath}/static/validate/jquery-html5Validate.js"></script>
		<script type="text/javascript">
			var layerIndex = parent.layer.getFrameIndex(window.name); //获取窗口索引
			
			$(function(){
				$("form").html5Validate(function() {
					if($("#form_token").val()==0){
						layer.alert("表单并未修改请勿提交!", {icon: 7,title:"提示"});
						return false;
					}
					if( typeof saveBefore === 'function' ){
						saveBefore();
			        }
					$("#btn_save").attr("disabled","disabled");
					var appindex = appLoading();
					var $form = $(this);
					
					var ajax = new $ax($form.attr("data-url"), function(data){
						if (data.code === 0) {
							clearLoading(appindex);
							layer.msg(data.message, {shift: 1});
							setTimeout(function(){
								closeTab(true);
							},500);
							return false;
						} else {
							clearLoading(appindex);
							$("#btn_save").removeAttr("disabled","disabled");
							if(data.code===999){
								layer.alert(data.message, {icon: 2,title:"发生错误"});
							}
							else{
								layer.msg(data.message, {shift: 6,time:2000});
							}
							return false;
						}
					});
					ajax.data = $form.serialize();
					ajax.start();
					
					return false;
				}, {
					// novalidate: false
				});
				
				$("#btn_close").bind("click",function(){
					closeTab(("${auto_close!}" == "true") ? true : false);
				});
				
				function closeTab(isReload){
					//未找到layerIndex代表为新增tab页
					if(typeof (layerIndex) == "undefined"){
						var tabId = "";
						var dataUrl = $("form").attr("data-url");
						if(typeof (dataUrl) == "undefined"){
							tabId = "btn_${code}_view_${id!}";
						}else if(dataUrl.indexOf("save") > 0){
							tabId = "btn_${code}_add";
						}else if(dataUrl.indexOf("update") > 0){
							tabId = "btn_${code}_edit_${id!}";
						}else{
							tabId = "btn_${code}_view_${id!}";
						}
						if(isReload){
							window.top.reloadTabById("${code!}")
						}
						window.top.autoClose(tabId,"${code!}");
					} else{
						if(isReload){
							parent.searchGrid();
						}
						parent.layer.close(layerIndex);
					}
				}
				
			});
		</script>